#ifndef STORAGE_H
#define STORAGE_H

#include <stdlib.h>
#include "Key.h"
#include "../Scanner-Automat/Token.h"

class Storage {
private:
	char* store;
	char* startFreeSpace;
	char* lastBlock;

	size_t sizeFree;
	size_t size;
	size_t lastBlockSize;
	size_t length;

	void expand();
	void writeNextBlockPosition(char* next);

public:
	Storage(size_t initLength);
	virtual ~Storage();

	Key insert(char* lexem, TokenType t);
	char* allocSpace(size_t wordLength);
};

#endif
